home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-18 | 1.5 KB | 55 lines | [TEXT/R*ch] |
- Q: How do I use AppendDITL() in a Think Pascal project?
-
- A: This call was new to System 7 and never really made it into the old
- toolbox library. It is, however, declared in the CommToolBox.lib. Here is the
- way to get it working.
- Add CommToolBox.lib to your project.
- Create a unit (or modify an existing one) that declares AppendDITL as
- external. Something like:
-
- unit myDeclarations;
- interface
-
- procedure AppendDITL(
- theDialog:DialogPtr;
- theHandle:Handle;
- method:integer);
-
- implementation
-
- procedure AppendDITL(
- theDialog:DialogPtr;
- theHandle:Handle;
- method:integer);
- external;
-
- end.
-
- Notice that I changed the method parameter to an integer type, so that I
- would not have to declare DITLMethod also. (You may want to declare that, and
- the method constants also for elegance.)
-
- Q: Do I still have to use the pragmas for instantiation of static templates?
-
- A: No. The compiler now accepts template-explicit instantiation as outlined
- in the ANSI C++ draft standard (dated 9/26/95) Section 14.4 pp. 14-15. The
- following pre-8.1.0 statements:
-
- template <class T> void f(T t);
- template <class T> class X { };
-
- #pragma template_access public
- #pragma template f(int)
- #pragma template X<int>
-
- are equivalent to:
-
- template <class T> void f(T t);
- template <class T> class X { };
-
- template void f(int);
- template class X<int>;
-
- Note: The old method of using #pragma template directives continues to be
- supported.
-